package com.lifeng.zk.zkclient.watch;

import org.I0Itec.zkclient.IZkDataListener;


/**
 * Created by lifeng on 2018/6/14.
 * 订阅节点的数据内容的变化
 */
public class MyDataWatcher implements IZkDataListener{

    public void handleDataChange(String dataPath, Object data) throws Exception {
        System.out.println("数据改变了");
        System.out.println("node:"+dataPath+",data:"+data);
    }

    public void handleDataDeleted(String dataPath) throws Exception {
        System.out.println(dataPath+"数据被删除了");
    }
}
